using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Sispe.Entities
{
    public partial class REFERENCIA : BaseEntity
    {
        public REFERENCIA()
        {
            this.TRABAJADORs = new List<TRABAJADOR>();
        }
        [Key]
        public int IdReferencia { get; set; }

        [Display(Name = "IdPersona")]
        [Required(ErrorMessage = "La Persona es requerida")]
        [Range(1, 10000000, ErrorMessage = "Debe elegir una Persona")]
        public int IdPersona { get; set; }


        [Display(Name = "Parentesco")]
        [Required(ErrorMessage = "El Parentesco es requerido")]
        public string Parentesco { get; set; }

        public virtual PERSONA PERSONA { get; set; }
        public virtual ICollection<TRABAJADOR> TRABAJADORs { get; set; }
        public string ParentescoCompleto
        {
            get
            {
                return Parentesco + " - " + PERSONA;
            }
        }

        public override string ToString()
        {
            return Parentesco + " -  " + PERSONA;
        }
    }
}
